package betandregret;

import java.util.ListIterator;

public class TeamCollection extends Collection<Team>{


	public Team findeTeam(int tid) {
		ListIterator<Team> iterator = liste.listIterator();
		
		while(iterator.hasNext()){
			Team currentTeam= iterator.next();
			if (tid == currentTeam.getId()){
				return currentTeam;
			}
		}
		return null;
	}

	public String toString(){
		StringBuilder sb = new StringBuilder();
		
		ListIterator<Team> iterator = liste.listIterator();
		while(iterator.hasNext()){
			sb.append( iterator.next().toString() + '\n');
		}	
		return sb.toString();
	}
}
